#ifndef LOGICINTERFACEUSB_H
#define LOGICINTERFACEUSB_H

#include <stdint.h>
#include "LogicPool/LogicInterface.h"


class LogicInterfaceUSB : public LogicInterface
{

  protected:

	char * device;
	int fd;

  public:

    LogicInterfaceUSB(char *idevice) : device(idevice), fd(0) {};
    virtual ~LogicInterfaceUSB() { Close(); };

	virtual void Open();
	virtual void Close();

	virtual void Reset();
	virtual uint32_t GetID();
	virtual void SetAddress(uint8_t type, uint8_t number, uint8_t addr);
	virtual void SetShortAddress(uint8_t number, uint8_t addr);

	virtual uint8_t ReadByte();
	virtual void WriteByte(uint8_t data);
	virtual uint16_t ReadWord();

	virtual void ReadWordFIFO(uint16_t * data, uint16_t n);
	virtual void WriteWord(uint16_t data);

	virtual uint32_t ReadLong();
	virtual void WriteLong(uint32_t data);
};


#endif

